home *** CD-ROM | disk | FTP | other *** search
/ CDUTIL 13 / CDUTIL #13 Julio 1995.iso / windows / acadwin / ads / cpp / dde / ddeconx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-08  |  3.3 KB  |  102 lines

  1. /* 
  2.     DDECONX.H -
  3.     
  4.     This file:
  5.  
  6.         Declares pure virtual DDE connection object, DDE_CONNECTION. 
  7.  
  8.     (C) Copyright 1988-1994 by Autodesk, Inc.
  9.  
  10.     This program is copyrighted by Autodesk, Inc. and is  licensed
  11.     to you under the following conditions.  You may not distribute
  12.     or  publish the source code of this program in any form.   You
  13.     may  incorporate this code in object form in derivative  works
  14.     provided  such  derivative  works  are  (i.) are  designed and
  15.     intended  to  work  solely  with  Autodesk, Inc. products, and
  16.     (ii.)  contain  Autodesk's  copyright  notice  "(C)  Copyright
  17.     1988-1994 by Autodesk, Inc."
  18.  
  19.     AUTODESK  PROVIDES THIS PROGRAM "AS IS" AND WITH  ALL  FAULTS.
  20.     AUTODESK  SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF  MER-
  21.     CHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK,  INC.
  22.     DOES  NOT  WARRANT THAT THE OPERATION OF THE PROGRAM  WILL  BE
  23.     UNINTERRUPTED OR ERROR FREE.
  24.  
  25. */
  26. #ifndef DDECONX_H
  27. #define DDECONX_H
  28.  
  29. #include "ddeinc.h"
  30.  
  31. //-----------------------------------------------------------------------------
  32. class DDE_CONNECTION;
  33.  
  34. //-----------------------------------------------------------------------------
  35. enum LINK_TYPE
  36. {
  37.     HOT_LINK
  38.     , WARM_LINK
  39.     , COLD_LINK
  40. };
  41.  
  42. //-----------------------------------------------------------------------------
  43. class DDE_CONNECTION : public ADS_OBJ
  44. {
  45.     friend                      DDE_HCONV;
  46.     friend                      DDE_ITEM;
  47.     friend                      DDE_TOPIC;
  48.     friend                      DDE_SERVICE;
  49.     friend                      DDE_STRING_HANDLE;
  50.  
  51. protected:
  52.     DWORD                       transfer_result;
  53.     UINT                        cur_format;
  54.  
  55.     LINK_TYPE                   linkage;
  56.     BOOL                        linking;
  57.  
  58.     BOOL                        connecting;
  59.  
  60.     DDE_HCONV                   *cur_conv;
  61.  
  62.     DDE_SERVICE                 *dde_service;
  63.     DDE_TOPIC                   *dde_topic;
  64.     DDE_ITEM                    *dde_item;
  65.  
  66.     LPBYTE                      cur_item_data;
  67.     int                         item_len;
  68.  
  69. public:
  70.                                 DDE_CONNECTION();
  71.  
  72.                                 // to initialize dde_service etc.
  73.     virtual BOOL                Init( ADS_STRING& default_service_name 
  74.                                     , ADS_STRING& default_topic_name
  75.                                     , ADS_STRING& default_item_name );
  76.     virtual BOOL                InitService( ADS_STRING& service_name );
  77.     virtual BOOL                InitTopic( ADS_STRING& topic_name );
  78.     virtual BOOL                InitItem( ADS_STRING& item_name );
  79.  
  80.                                 ~DDE_CONNECTION();
  81.  
  82.     virtual BOOL                Valid();
  83.     virtual BOOL                SetupConnection() = 0;
  84.     virtual BOOL                RemoveConnection();
  85.  
  86.     virtual BOOL                Link() = 0;
  87.     virtual BOOL                Unlink() = 0;
  88.  
  89.     HSZ                         DDEItem() { return dde_item->Handle(); }
  90.     HSZ                         DDETopic(){ return dde_topic->Handle(); }
  91.     HSZ                         DDEService(){ return dde_service->Handle(); }
  92.  
  93. private:
  94.     BASIC_CPP_STUFF(DDE_CONNECTION)
  95. };
  96.  
  97. //
  98. //  inline functions
  99. //
  100.  
  101. #endif
  102.